//: Playground - noun: a place where people can play

import UIKit

class TpCalculator
{

    // 2
    let total: Double 
    let taxPct: Double
    let subtotal: Double

    
    init(total: Double, taxPct: Double)
    {
        self.total = total
        self.taxPct = taxPct
        self.subtotal = total / (taxPct + 1)
    }
}


//import CoreFoundation
//import CoreGraphics
//import Foundation

//var str = "Hello, playground"
//
//var url = NSURL(string: "http://m.weather.com.cn/atad/101010100.html")
//
////@availability(iOS, introduced=2.0, deprecated=8.0, message="Use +dataWithContentsOfURL:options:error: and NSDataReadingMappedIfSafe or NSDataReadingMappedAlways instead.")
//
//
//var data = NSData(contentsOfURL:url!, options: NSDataReadingOptions.DataReadingUncached, error: nil)
//
////        var data = NSData.ininc( url,options:NSDataReadingOptions.DataReadingUncached, error: nil)
//var json:AnyObject = NSJSONSerialization.JSONObjectWithData(data! ,options: NSJSONReadingOptions.AllowFragments, error: nil)!;
//
//
//var weartheInfo = json.objectForKey("weatherinfo")
//var wearthCity = weartheInfo?.objectForKey("city")
//var wearthCityen = weartheInfo?.objectForKey("city_en")
//var wearthCityID = weartheInfo?.objectForKey("cityid")
//var wearthCityDate = weartheInfo?.objectForKey("date_y")
//var wearthCityfchh = weartheInfo?.objectForKey("fchh")
//
//var wearthValues = weartheInfo?.valueForKey("fl1");
//
//
//println("is wearthValues \(wearthValues)");
//
//
//println("is json \(json)");
//
//println("is wearthCityDate \(wearthCityDate)");
//
//println("is wearthCity \(wearthCity)");
